<?php
$position = ($last == 'last') ? 'last' : '';
?>
<div class="contentContainer page_un nested <?php echo $position; ?>">
    <div class="contentPadd">
        <div class="prods_content prods_table">
            <ul class="row_featured_name row_featured_block first last" id="row_featured-0">
                <?php
                if (!empty($items)) {
                    foreach ($items as $key => $item) {
                        if ($key < 2) {
                            ?>
                            <li style="width: 218px; min-height: 400px;"
                                class="wrapper_prods equal-height_featured_block hover <?php $key == 0 ? 'first' : ''; ?>">
                                <div>
                                    <div class="border_prods">
                                        <div class="pic_padd wrapper_pic_div" style="width:180px;height:180px;">
                                            <a class="prods_pic_bg"
                                               onclick="window.location.href='<?php echo $this->createUrl('/site/detail', array('id' => $item->id))?>';return false;"
                                               style="width:180px;height:180px;">
                                                <img src="<?php echo Yii::app()->request->baseUrl . $item->avatar ?>"
                                                     alt="<?php echo Yii::app()->request->baseUrl . $item->name ?>"
                                                     title="<?php echo Yii::app()->request->baseUrl . $item->name ?>"
                                                     width="180" height="180"
                                                     style="width:180px;height:180px;margin:0px 0px 0px 0px;"></a>
                                        </div>
                                        <div class="prods_padd">
                                            <div class="name name_padd equal-height_featured_name"
                                                 style="min-height: 18px;">
                                                <div>
                                                <span>
                                                    <a href="<?php echo $this->createUrl('/site/detail', array('id' => $item->id))?>">
                                                        <?php echo $item['name']?>
                                                    </a>
                                                </span>
                                                </div>
                                            </div>
                                            <div class="desc desc_padd"><?php echo $item['categoryId']?>
                                            </div>
                                            <div class="price price_padd extra">
                                                <b>Price:&nbsp;&nbsp;</b><span
                                                    class="productSpecialPrice"><?php echo $item['price']?></span>
                                            </div>
                                            <div class="button__padd">
                                                <strong class="button_content button_content2"><strong
                                                        class="button bg_button"><strong class="button-t"><a
                                                                href="<?php echo $this->createUrl('/site/detail', array('id' => $item->id))?>"
                                                                class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary ui-priority-secondary"
                                                                role="button">
                                                                <span
                                                                    class="ui-button-icon-primary ui-icon ui-icon-cart"></span><span
                                                                    class="ui-button-text">Add&nbsp;to&nbsp;Cart</span></a></strong></strong></strong>
                                                <strong class="button_content button_content22"><strong
                                                        class="button bg_button"><strong class="button-t"><a
                                                                href="<?php echo $this->createUrl('/site/detail', array('id' => $item->id))?>"
                                                                class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary ui-priority-secondary"
                                                                role="button"><span
                                                                    class="ui-button-icon-primary ui-icon ui-icon-triangle-1-e"></span><span
                                                                    class="ui-button-text">Details</span></a></strong></strong></strong>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </li>
                            <li class="prods_vseparator equal-height_featured_block"
                                style="min-height: 402px;">
                                <div><img src="<?php echo Yii::app()->request->baseUrl; ?>/css/images/spacer.gif" alt=""
                                          width="1" height="1">

                                    <div class="prods_vseparator_img"></div>
                                </div>
                            </li>
                        <?php } ?>
                        <?php if ($key == 2) {
                            ?>
                            <li style="width: 218px; min-height: 400px;"
                                class="wrapper_prods equal-height_featured_block hover last">
                                <div>
                                    <div class="border_prods">
                                        <div class="pic_padd wrapper_pic_div" style="width:180px;height:180px;">
                                            <a class="prods_pic_bg"
                                               onclick="window.location.href='<?php echo $this->createUrl('/site/detail', array('id' => $item->id))?>';return false;"
                                               style="width:180px;height:180px;"><img
                                                    src="<?php echo Yii::app()->request->baseUrl . $item->avatar ?>"
                                                    alt="<?php echo Yii::app()->request->baseUrl . $item->name ?>"
                                                    title="<?php echo Yii::app()->request->baseUrl . $item->name ?>"
                                                    width="180"
                                                    height="180"
                                                    style="width:180px;height:180px;margin:0px 0px 0px 0px;"></a></div>
                                        <div class="sale_percent ">
                                            <strong>-90%</strong></div>
                                        <div class="prods_padd">
                                            <div class="name name_padd equal-height_featured_name"
                                                 style="min-height: 18px;">
                                                <div><span>
                                                        <a href="<?php echo $this->createUrl('/site/detail', array('id' => $item->id))?>"> <?php echo $item['name']?>
                                                        </a></span></div>
                                            </div>
                                            <div class="desc desc_padd"><?php echo $item['name']?></div>
                                            <div class="price price_padd "><b>Price:&nbsp;&nbsp;</b><span
                                                    class="productSpecialPrice"><?php echo $item['price']?></span>
                                                <del>Giá cũ</del>
                                            </div>
                                            <div class="button__padd"><strong
                                                    class="button_content button_content2"><strong
                                                        class="button bg_button"><strong class="button-t"><a
                                                                href="<?php echo $this->createUrl('/site/detail', array('id' => $item->id))?>"
                                                                class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary ui-priority-secondary"
                                                                role="button"><span
                                                                    class="ui-button-icon-primary ui-icon ui-icon-cart"></span><span
                                                                    class="ui-button-text">Add&nbsp;to&nbsp;Cart</span></a></strong></strong></strong>
                                                <strong class="button_content button_content22"><strong
                                                        class="button bg_button"><strong class="button-t"><a
                                                                href="<?php echo $this->createUrl('/site/detail', array('id' => $item->id))?>"
                                                                class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary ui-priority-secondary"
                                                                role="button"><span
                                                                    class="ui-button-icon-primary ui-icon ui-icon-triangle-1-e"></span><span
                                                                    class="ui-button-text">Details</span></a></strong></strong></strong>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </li>
                        <?php } ?>
                    <?php
                    }
                }
                ?>
            </ul>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        var row_list_featured_name = $('.row_featured_name');
        row_list_featured_name.each(function () {
            new equalHeights_featured_name($('#' + $(this).attr("id")));
        });
        var row_list_featured_block = $('.row_featured_block');
        row_list_featured_block.each(function () {
            new equalHeights_featured_block($('#' + $(this).attr("id")));
        });
    })
</script>